Skip to content

feat: reuse agent tokens when a prebuilt agent reinitializes #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

SasSwart
Copy link
Contributor

@SasSwart SasSwart commented Apr 3, 2025

This PR closes #364

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is definitely worth an integration test :-)

Base automatically changed from jjs/363 to main April 7, 2025 06:20
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this PR is ready for review yet, is it?

@SasSwart SasSwart marked this pull request as draft April 10, 2025 10:09
Comment on lines 55 to 57
} else {
tflog.Info(ctx, "using a new agent token", logFields)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary to log this case.

Suggested change
} else {
tflog.Info(ctx, "using a new agent token", logFields)
}
}

// and after the workspace was claimed by a user.
//
// agentID is unused for now, but will be used as soon as we support multiple agents.
func RunningAgentTokenEnvironmentVariable(agentID string) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will the ID be injected? How will we maintain a persistent identity across terraform apply runs?

@dannykopping dannykopping self-requested a review April 17, 2025 11:34
@SasSwart SasSwart marked this pull request as ready for review April 23, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants